/*DrillInfo  培训管理*/
import request from "/@/utils/request";
import download from "/@/utils/download.ts";

const DrillInfoApi = {

    getPageData(data: any) {
        return request({
            url: "/drillInfo/pageData",
            method: "post",
            data,
        });
    },
    getDetail(data: any) {
        return request({
            url: "/drillInfo/getDetail",
            method: "post",
            data,
        });
    },

    save: (data: any) => {
        return request({
            url: "/drillInfo/save",
            method: "post",
            data,
        });
    },

    del: (data: any) => {
        return request({
            url: "/drillInfo/del",
            method: "post",
            data,
        });
    },

    updateStatus: (data: any) => {
        return request({
            url: "/drillInfo/updateStatus",
            method: "post",
            data,
        });
    },
    pageDataXls:(_searchParam: any,_xlsTitle: any,_xlsName: any) => {
  const param = new URLSearchParams();
        param.append("_searchParam",JSON.stringify(_searchParam))
        param.append("_xlsTitle",_xlsTitle)
        param.append("_xlsName",_xlsName)
        return request({
            url: "/drillInfo/pageDataXls",
            method: "post",
            responseType: 'blob',
            headersType: 'application/json;charset=UTF-8',
               params:param,
        }).then((res)=> {
            download(res)
        });
    },
    getRegistrationQRCode(params: any) {
        return request({
            url: "/drillInfo/registrationQRCode",
            method: "get",
            params,
        });
    },
    getSignQRCode(params: any) {
        return request({
            url: "/drillInfo/signQRCode",
            method: "get",
            params,
        });
    },
    getLearningQRCode(params: any) {
        return request({
            url: "/drillInfo/learningQRCode",
            method: "get",
            params,
        });
    },
};
export default DrillInfoApi;
